home *** CD-ROM | disk | FTP | other *** search
- { peekpoke.pas - Include this file when you compile to implement PEEK and
- POKE functions. }
-
- {$P-}
-
- FUNCTION peek( address: long_integer ): long_integer;
-
- TYPE
- byte_ptr = ^byte;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: byte_ptr );
- END;
-
- BEGIN
- funny.a := address;
- peek := funny.p^;
- END;
-
- FUNCTION wpeek( address: long_integer ): long_integer;
-
- TYPE
- int_ptr = ^integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: int_ptr );
- END;
-
- BEGIN
- funny.a := address;
- wpeek := funny.p^;
- END;
-
- FUNCTION lpeek( address: long_integer ): long_integer;
-
- TYPE
- lint_ptr = ^long_integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: lint_ptr );
- END;
-
- BEGIN
- funny.a := address;
- lpeek := funny.p^;
- END;
-
- PROCEDURE poke( address: long_integer; value: byte );
-
- TYPE
- lint_ptr = ^long_integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: lint_ptr );
- END;
-
- BEGIN
- funny.a := address;
- funny.p^ := value;
- END;
-
- PROCEDURE wpoke( address: long_integer; value: integer );
-
- TYPE
- int_ptr = ^integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: int_ptr );
- END;
-
- BEGIN
- funny.a := address;
- funny.p^ := value;
- END;
-
- PROCEDURE lpoke( address, value: long_integer );
-
- TYPE
- lint_ptr = ^long_integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: lint_ptr );
- END;
-
- BEGIN
- funny.a := address;
- funny.p^ := value;
- END;
-
- {$P=}
-